<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<html>
<head>
<!-- Copyright 1997 The Open Group, All Rights Reserved -->
<title>Error Numbers</title>
</head><body bgcolor=white>
<center>
<font size=2>
The Single UNIX &reg; Specification, Version 2<br>
Copyright &copy; 1997 The Open Group

</font></center><hr size=2 noshade><blockquote>
<center>
<h3><a name = "tag_000_004">&nbsp;</a>Error Numbers</h3>
</center>
<xref type="2" name="error"></xref>
Most functions can provide an error number.  The means by which each
function provides its error numbers is specified in its description.
<p>
Some functions provide the error number in a variable accessed through
the symbol <i>errno</i>.  The symbol <i>errno</i>, defined by including
the header
<i><a href="errno.h.html">&lt;errno.h&gt;</a></i>,
is a macro that expands to a modifiable lvalue of type <b>int</b>.
<p>
The value of <i>errno</i> should only be examined when it is indicated to be
valid by a function's return value.  No function in this specification sets
<i>errno</i> to zero to indicate an error.  For each thread of a process, the
value of <i>errno</i> is not affected by function calls or assignments to
<i>errno</i> by other threads.
<p>
Some functions return an error number directly as the function value.
These functions return a value of zero to indicate success.
<p>
If more than one error occurs in processing a function call,
any one of the possible errors may be returned, as the order
of detection is undefined.
<p>
Implementations may support additional errors not included in this
list, may generate errors included in this list under circumstances
other than those described here, or may contain extensions or limitations
that prevent some errors from occurring.  The ERRORS
section on each page specifies whether an error will be returned,
or whether it may be returned.  Implementations
will not generate a different error number from the ones described here
for error conditions described in this specification, but may
generate additional errors unless explicitly disallowed for a
particular function.
<p>
The following symbolic names identify the possible error numbers,
in the context of the functions specifically defined in this specification;
these general descriptions are more precisely defined in the
ERRORS sections of the functions that return them.
Only these symbolic names should be used in programs, since the
actual value of the error number is unspecified.
All values listed in this section are unique
except as noted below.
The values for all these names can be found in the header
<i><a href="errno.h.html">&lt;errno.h&gt;</a></i>.
<dl compact>

<dt>[E2BIG]<dd><index term="E2BIG, "></index>

Argument list too long

The sum of the number of bytes used by the new process image's argument
list and environment list is greater than the system-imposed limit
of {ARG_MAX} bytes.

<dt>[EACCES]<dd><index term="EACCES, "></index>

Permission denied

An attempt was made to access a file in a way forbidden by its file
access permissions.

<dt>[EADDRINUSE]<dd><index term="EADDRINUSE, "></index>

Address in use

The specified address is in use.

<dt>[EADDRNOTAVAIL]<dd><index term="EADDRNOTAVAIL, "></index>

Address not available

The specified address is not available from the local system.

<dt>[EAFNOSUPPORT]<dd><index term="EAFNOSUPPORT, "></index>

Address family not supported

The implementation does not support the specified address family, or
the specified address is not a valid address for the address family of
the specified socket.

<dt>[EAGAIN]<dd><index term="EAGAIN, "></index>

Resource temporarily unavailable

This is a temporary condition and later calls to the same routine
may complete normally.

<dt>[EALREADY]<dd><index term="EALREADY, "></index>

Connection already in progress

A connection request is already in progress for the specified socket.

<dt>[EBADF]<dd><index term="EBADF, "></index>

Bad file descriptor

A file descriptor argument is out of range, refers to no open file, or
a read (write) request is made to a file that is only open for
writing (reading).


<dt>[EBADMSG]<dd><index term="EBADMSG, "></index>

Bad message

During a
<i><a href="read.html">read()</a></i>,
<i><a href="getmsg.html">getmsg()</a></i>
or
<i><a href="ioctl.html">ioctl()</a></i>
I_RECVFD request to a STREAMS device, a message arrived at the head of the
STREAM that is inappropriate for the function receiving the message.
<ul>

<li>
<i><a href="read.html">read()</a></i>
- message waiting to be read on a STREAM is not a data message.

<li>
<i><a href="getmsg.html">getmsg()</a></i>
- a file descriptor was received instead of a control message.

<li>
<i><a href="ioctl.html">ioctl()</a></i>
- control or data information was received instead of a file
descriptor when I_RECVFD was specified.

</ul>

<dt>[EBADMSG]<dd><index term="EBADMSG, "></index>

Bad Message

The implementation has detected a corrupted message.

<dt>[EBUSY]<dd><index term="EBUSY, "></index>

Resource busy

An attempt was made to make use of a system resource that is not currently
available, as it is being used by another process in a manner
that would have conflicted with the request being made by this process.

<dt>[ECANCELED]<dd><index term="ECANCELED, "></index>

Operation canceled

The associated asynchronous operation was canceled before completion.

<dt>[ECHILD]<dd><index term="ECHILD, "></index>

No child process

A
<i><a href="wait.html">wait()</a></i>
or
<i><a href="waitpid.html">waitpid()</a></i>
function was executed by
a process that had no existing or unwaited-for child process.

<dt>[ECONNABORTED]<dd><index term="ECONNABORTED, "></index>

Connection aborted

The connection has been aborted.

<dt>[ECONNREFUSED]<dd><index term="ECONNREFUSED, "></index>

Connection refused

An attempt to connect to a socket was refused because there was
no process listening or because the queue of connection requests was full
and the underlying protocol does not support retransmissions.

<dt>[ECONNRESET]<dd><index term="ECONNRESET, "></index>

Connection reset

The connection was forcibly closed by the peer.

<dt>[EDEADLK]<dd><index term="EDEADLK, "></index>

Resource deadlock would occur

An attempt was made to lock a system resource that would have resulted
in a deadlock situation.

<dt>[EDESTADDRREQ]<dd><index term="EDESTADDRREQ, "></index>

Destination address required

No bind address was established.

<dt>[EDOM]<dd><index term="EDOM, "></index>

Domain error

An input argument is outside the defined domain of the mathematical function.
(Defined in the ISO&nbsp;C standard.)

<dt>[EDQUOT]<dd><index term="EDQUOT, "></index>

Reserved

<dt>[EEXIST]<dd><index term="EEXIST, "></index>

File exists

An existing file was mentioned in an inappropriate context, for instance, as
a new link name in the
<i><a href="link.html">link()</a></i>
function.

<dt>[EFAULT]<dd><index term="EFAULT, "></index>

Bad address

The system detected an invalid address in attempting to use an argument of
a call. The reliable detection of this error cannot be guaranteed,
and when not detected may result in the generation of a signal,
indicating an address violation, which is sent to the process.

<dt>[EFBIG]<dd><index term="EFBIG, "></index>

File too large

The size of a file would exceed the maximum file size of an
implementation or offset maximum established in the corresponding file
description.

<dt>[EHOSTUNREACH]<dd>

Host is unreachable

The destination host cannot be reached (probably because the host is down or a
remote router cannot reach it).

<dt>[EIDRM]<dd><index term="EIDRM, "></index>

Identifier removed

Returned during interprocess communication if an identifier has been
removed from the system.

<dt>[EINPROGRESS]<dd><index term="EINPROGRESS, "></index>

Operation in progress

This code is used to indicate that an asynchronous operation has not
yet completed.

<dt>[EINPROGRESS]<dd><index term="EINPROGRESS, "></index>

O_NONBLOCK is set for the socket file descriptor and the connection
cannot be immediately established.

<dt>[EILSEQ]<dd><index term="EILSEQ, "></index>

Illegal byte sequence

A wide-character code has been detected that does not correspond
to a valid character, or a byte sequence does not form a valid
wide-character code.

<dt>[EINTR]<dd><index term="EINTR, "></index>

Interrupted function call

An asynchronous signal was caught by the process during the execution of
an interruptible function. If the signal handler performs a normal return,
the interrupted function call may return this condition.
(See
<i><a href="signal.h.html">&lt;signal.h&gt;</a></i>.)

<dt>[EINVAL]<dd><index term="EINVAL, "></index>

Invalid argument

Some invalid argument was supplied; (for example, specifying an
undefined signal in
a
<i><a href="signal.html">signal()</a></i>
function or a
<i><a href="kill.html">kill()</a></i>
function).


<dt>[EIO]<dd><index term="EIO, "></index>

Input/output error

Some physical input or output error has occurred. This error may be
reported on a subsequent operation on the same file descriptor. Any
other error-causing operation on the same file descriptor may cause
the [EIO] error indication to be lost.

<dt>[EISCONN]<dd><index term="EISCONN, "></index>

Socket is connected

The specified socket is already connected.

<dt>[EISDIR]<dd><index term="EISDIR, "></index>

Is a directory

An attempt was made to open a directory with write mode specified.

<dt>[ELOOP]<dd><index term="ELOOP, "></index>

Too many levels of symbolic links

Too many symbolic links were encountered in resolving a pathname.

<dt>[EMFILE]<dd><index term="EMFILE, "></index>

Too many open files

An attempt was made to open more than the maximum number of {OPEN_MAX}
file descriptors allowed in this process.

<dt>[EMLINK]<dd><index term="EMLINK, "></index>

Too many links

An attempt was made to have the link count of a single file exceed {LINK_MAX}.


<dt>[EMSGSIZE]<dd><index term="EMSGSIZE, "></index>

Message too large

A message sent on a transport provider was larger
than an internal message buffer or some other network limit.

<dt>[EMSGSIZE]<dd><index term="EMSGSIZE, "></index>

Inappropriate message buffer length.

<dt>[EMULTIHOP]<dd><index term="EMULTIHOP, "></index>

Reserved

<dt>[ENAMETOOLONG]<dd><index term="ENAMETOOLONG, "></index>

Filename too long

The length of a pathname exceeds {PATH_MAX}, or a pathname component is longer
than {NAME_MAX} and {_POSIX_NO_TRUNC} was in effect for that file.

<dt>[ENETDOWN]<dd><index term="ENETDOWN, "></index>

Network is down

The local interface used to reach the destination is down.

<dt>[ENETUNREACH]<dd><index term="ENETUNREACH, "></index>

Network unreachable

No route to the network is present.

<dt>[ENFILE]<dd><index term="ENFILE, "></index>

Too many files open in system

Too many files are currently open in the system. The system has reached its
predefined limit for simultaneously open files and temporarily cannot
accept requests to open another one.

<dt>[ENOBUFS]<dd><index term="ENOBUFS, "></index>

No buffer space available

Insufficient buffer resources were available in the system to perform
the socket operation.

<dt>[ENODATA]<dd><index term="ENODATA, "></index>

No message available

No message is available on the STREAM head read queue.

<dt>[ENODEV]<dd><index term="ENODEV, "></index>

No such device

An attempt was made to apply an inappropriate function to a device; for
example, trying to read a write-only device such as a printer.

<dt>[ENOENT]<dd><index term="ENOENT, "></index>

No such file or directory

A component of a specified pathname does not exist, or the pathname is an
empty string.

<dt>[ENOEXEC]<dd><index term="ENOEXEC, "></index>

Executable file format error

A request is made to execute a file that, although it has the appropriate
permissions, is not in the format required by the implementation for
executable files.

<dt>[ENOLCK]<dd><index term="ENOLCK, "></index>

No locks available

A system-imposed limit on the number of simultaneous file and record locks
has been reached and no more are currently available.

<dt>[ENOLINK]<dd><index term="ENOLINK, "></index>

Reserved

<dt>[ENOMEM]<dd><index term="ENOMEM, "></index>

Not enough space

The new process image requires more memory than is allowed by the hardware
or system-imposed memory management constraints.


<dt>[ENOMSG]<dd><index term="ENOMSG, "></index>

No message of the desired type

The message queue does not contain a message of the required type
during interprocess communication.

<dt>[ENOPROTOOPT]<dd><index term="ENOPROTOOPT, "></index>

Protocol not available

The protocol option specified to
<i><a href="../xns/setsockopt.html">setsockopt()</a></i>
is not supported by the implementation.

<dt>[ENOSPC]<dd><index term="ENOSPC, "></index>

No space left on a device

During the
<i><a href="write.html">write()</a></i>
function on a regular file or when extending
a directory, there is no free space left on the device.

<dt>[ENOSR]<dd><index term="ENOSR, "></index>

No STREAM resources

Insufficient STREAMS memory resources are available to perform a STREAMS
related function.  This is a temporary condition; one may recover from it if
other processes release resources.

<dt>[ENOSTR]<dd><index term="ENOSTR, "></index>

Not a STREAM

A STREAM function was attempted on a file descriptor that
was not associated with a STREAMS device.

<dt>[ENOSYS]<dd><index term="ENOSYS, "></index>

Function not implemented

An attempt was made to use a function that is not available in this
implementation.

<dt>[ENOTCONN]<dd><index term="ENOTCONN, "></index>

Socket not connected

The socket is not connected.

<dt>[ENOTDIR]<dd><index term="ENOTDIR, "></index>

Not a directory

A component of the specified pathname exists, but it is not a directory,
when a directory was expected.

<dt>[ENOTEMPTY]<dd><index term="ENOTEMPTY, "></index>

Directory not empty

A directory with entries other than dot and dot-dot was supplied when an
empty directory was expected.

<dt>[ENOTSOCK]<dd><index term="ENOTSOCK, "></index>

Not a socket

The file descriptor does not refer to a socket.

<dt>[ENOTSUP]<dd><index term="ENOTSUP, "></index>

Not supported

The implementation does not support this feature of the Realtime
Feature Group.

<dt>[ENOTTY]<dd><index term="ENOTTY, "></index>

Inappropriate I/O control operation

A control function has been attempted for a file or special file for which
the operation is inappropriate.


<dt>[ENXIO]<dd><index term="ENXIO, "></index>

No such device or address

Input or output on a special file refers to a device that does not exist,
or makes a request beyond the capabilities of the device. It may also occur
when, for example, a tape drive is not on-line.

<dt>[EOPNOTSUPP]<dd><index term="EOPNOTSUPP, "></index>

Operation not supported on socket

The type of socket (address family or protocol) does not support
the requested operation.

<dt>[EOVERFLOW]<dd><index term="EOVERFLOW, "></index>

Value too large to be stored in data type

The user ID or group ID of an IPC or file system
object was too large to be stored into appropriate member of the
caller-provided structure.  This error will only occur on implementations that
support a larger range of user ID or group ID values than the
declared structure member can support.  This usually occurs because
the IPC or file system object resides on a remote machine with a larger
value of the type <b>uid_t</b>, <b>off_t</b> or <b>gid_t</b> than the local
system.

<dt>[EPERM]<dd><index term="EPERM, "></index>

Operation not permitted

An attempt was made to perform an operation limited to processes with
appropriate privileges or to the owner of a file or other resource.

<dt>[EPIPE]<dd><index term="EPIPE, "></index>

Broken pipe

A write was attempted on a
&nbsp;socket,
&nbsp;pipe or FIFO for which there is no process to read the data.

<dt>[EPROTO]<dd><index term="EPROTO, "></index>

Protocol error

Some protocol error occurred.  This error is device specific, but is generally
not related to a hardware failure.

<dt>[EPROTONOSUPPORT]<dd><index term="EPROTONOSUPPORT, "></index>

Protocol not supported

The protocol is not supported by the address family, or
the protocol is not supported by the implementation.

<dt>[EPROTOTYPE]<dd><index term="EPROTOTYPE, "></index>

Socket type not supported

The socket type is not supported by the protocol.

<dt>[ERANGE]<dd><index term="ERANGE, "></index>

Result too large or too small

The result of the function is too large (overflow) or too small (underflow)
to be represented in the available space.
(Defined in the ISO&nbsp;C standard.)

<dt>[EROFS]<dd><index term="EROFS, "></index>

Read-only file system

An attempt was made to modify a file or directory on a file system that
is read only.

<dt>[ESPIPE]<dd><index term="ESPIPE, "></index>

Invalid seek

An attempt was made to access the file offset associated with a
pipe or FIFO.


<dt>[ESRCH]<dd><index term="ESRCH, "></index>

No such process

No process can be found corresponding to that specified by the given process
ID.

<dt>[ESTALE]<dd><index term="ESTALE, "></index>

Reserved

<dt>[ETIME]<dd><index term="ETIME, "></index>

STREAM
<i><a href="ioctl.html">ioctl()</a></i>
timeout

The timer set for a STREAMS
<i><a href="ioctl.html">ioctl()</a></i>
call has expired.  The cause of this error is device specific and could
indicate either a hardware or software failure, or a timeout value that is too
short for the specific operation.  The status of the
<i><a href="ioctl.html">ioctl()</a></i>
operation is indeterminate.

<dt>[ETIMEDOUT]<dd><index term="ETIMEDOUT, "></index>

Connection timed out

The connection to a remote machine has timed out.  If the connection timed out
during execution of the function that reported this error (as opposed to
timing out prior to the function being called), it is unspecified whether the
function has completed some or all of the documented behaviour associated with
a successful completion of the function.

<dt>[ETIMEDOUT]<dd><index term="ETIMEDOUT, "></index>

Operation timed out

The time limit associated with the operation was exceeded before the
operation completed.

<dt>[ETXTBSY]<dd><index term="ETXTBSY, "></index>

Text file busy

An attempt was made to execute a pure-procedure program that is currently
open for writing, or an attempt has been made to open for writing a
pure-procedure program that is being executed.

<dt>[EWOULDBLOCK]<dd><index term="EWOULDBLOCK, "></index>

Operation would block

An operation on a socket marked as non-blocking has encountered a
situation such as no data available that otherwise would have
caused the function to suspend execution.

An XSI-conforming implementation may assign the same values for
[EWOULDBLOCK] and [EAGAIN].

<dt>[EXDEV]<dd><index term="EXDEV, "></index>

Improper link

A link to a file on another file system was attempted.

</dl>
<h4><a name = "tag_000_004_001">&nbsp;</a>Additional Error Numbers</h4>
<xref type="3" name="adderr"></xref>
Additional implementation-dependent error numbers may be defined in
<i><a href="errno.h.html">&lt;errno.h&gt;</a></i>.
</blockquote><hr size=2 noshade>
<center><font size=2>
UNIX &reg; is a registered Trademark of The Open Group.<br>
Copyright &copy; 1997 The Open Group
<br> [ <a href="../index.html">Main Index</a> | <a href="../xshix.html">XSH</a> | <a href="../xcuix.html">XCU</a> | <a href="../xbdix.html">XBD</a> | <a href="../cursesix.html">XCURSES</a> | <a href="../xnsix.html">XNS</a> ]

</font></center><hr size=2 noshade>
</body></html>
